<?php echo $error;?>

<?php echo form_open_multipart(('items/do_upload'),array('id'=>'item_form')); ?>

<input type="file" name="userfile" size="20" />
<input type="submit" value="Upload" />
</form>

<script type='text/javascript'>

//validation and submit handling
$(document).ready(function()
{	
	$('#item_form').validate({
		submitHandler:function(form)
		{
			$(form).ajaxSubmit({
			success:function(response)
			{
				tb_remove();
				post_item_form_submit(response);
			},
			dataType:'json'
		});

		}
	});
});
</script>